﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Data;
using System.Globalization;

namespace twilters
{
    [ValueConversion(typeof(MatchType), typeof(String))]
    class MatchTypeConverter : IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return value.ToString();
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return (MatchType)Enum.Parse(typeof(MatchType), value as String, true);
        }

        #endregion
    }
}
